package com.example.mapper;

//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface StudentMapper  {
    @Select("SELECT * FROM student")
    List<Student> finAll();

    @Select("SELECT * FROM student where stu_num=#{stu_num}")
    List<Student> findAllByid(String stu_num);

    @Select("SELECT * FROM student where stu_num=#{stu_num}")
    Student findAllByid1(String stu_num);


    int insert(Student student);
    int insert1(Student student);
    int update(Student student);

    @Delete("DELETE FROM student WHERE stu_num = #{stu_num}")
    Integer deleteBy(@Param("stu_num") String stu_num);


    @Select("select * from student where name like concat( '%',#{name},'%')limit #{pageNum}, #{pageSize}")
    List<Student> selectPage(@Param("pageNum")Integer pageNum, @Param("pageSize")Integer pageSize,@Param("name")String name);

    @Select("select count(*) from student where name like concat( '%',#{name},'%')")
    Integer selectTotal(@Param("name") String name);

    @Select("SELECT * FROM student WHERE stu_num = #{username}")
        Student getStudentByUsername(String username);

    void updatepassword(Student student);
}
